﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.Composition;
using Kooboo.Commerce.AddIn;

namespace Kooboo.Commerce.Validators
{

    [Export(typeof(IValidator))]
    public class Required : IValidator
    {
        public string Name
        {
            get
            {
                return "Required";
            }
        }

        public bool Validate(string value, List<ValidatorParameter> args)
        {
            return value != null
                || string.IsNullOrWhiteSpace(value.ToString()) == false;
        }

        public List<ValidatorParameter> GetParameters()
        {
            return new List<ValidatorParameter>();
        }
    }
}